import java.util.Scanner;

/**
 * 用户服务
 *
 * @author yuwei
 * @date 15:17 2024/4/24
 */
public class system {
    public static void index() {
        System.out.println("--------学堂管理系统---------");
        System.out.println("1.人事管理");
        System.out.println("2.财务管理");
        System.out.println("3.考勤管理");
        System.out.println("4.退出");
        System.out.println("请输入您的选择：");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                personnel();
                break;
            case 2:
                finance();
                break;
            case 3:
                attendance();
                break;
            case 4:
                System.exit(0);
                break;
            default:
                System.out.println("输入错误，请重新输入");
                index();
        }
    }

    public static void personnel() {
        System.out.println("---------人事管理--------");
        System.out.println("1.部门管理");
        System.out.println("2.岗位管理");
        System.out.println("3.员工管理");
        System.out.println("4.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                department();
                personnel();
                break;
            case 2:
                position();
                personnel();
                break;
            case 3:
                employee();
                personnel();
                break;
            case 4:
                index();
                break;
            default:
                System.out.println("输入错误，请重新输入");
                personnel();
        }
    }

    public static void department() {
        System.out.println("-------部门管理------");
        System.out.println("1.添加部门");
        System.out.println("2.查看部门");
        System.out.println("3.删除部门");
        System.out.println("4.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                departmentManage.add();
                department();
                break;
            case 2:
                departmentManage.show();
                department();
                break;
            case 3:
                departmentManage.delete();
                department();
                break;
            case 4:
                personnel();
                break;
            default:
                System.out.println("输入错误，请重新输入");
                department();

        }

    }

    public static void position() {
        System.out.println("-------岗位管理------");
        System.out.println("1.添加岗位");
        System.out.println("2.查看岗位");
        System.out.println("3.删除岗位");
        System.out.println("4.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                positionManage.add();
                position();
                break;
            case 2:
                positionManage.show();
                position();

                break;
            case 3:
                positionManage.delete();
                position();

                break;
            case 4:
                personnel();

                break;
            default:
                System.out.println("输入错误，请重新输入");
                position();

        }


    }

    public static void employee() {
        System.out.println("-------员工管理------");
        System.out.println("1.添加员工");
        System.out.println("2.查看员工");
        System.out.println("3.删除员工");
        System.out.println("4.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                employeeManage.add();
                employee();
                break;
            case 2:
                employeeManage.show();
                employee();

                break;
            case 3:
                employeeManage.delete();
                employee();

                break;
            case 4:
                position();

                break;
            default:
                System.out.println("输入错误，请重新输入");
                employee();

        }


    }

    public static void finance() {
        System.out.println("---------财务管理--------");
        System.out.println("1.收支管理");
        System.out.println("2.报销管理");
        System.out.println("3.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                accountManage.menu();
                finance();
                break;
            case 2:
                claimManage.menu();
                finance();
            case 3:
                index();
            default:
                System.out.println("输入错误");
                finance();

        }
    }
    public static void attendance() {
        System.out.println("-------考勤管理------");
        System.out.println("1.添加考勤");
        System.out.println("2.查看考勤");
        System.out.println("3.删除考勤");
        System.out.println("4.返回");
        switch (new Scanner(System.in).nextInt()) {
            case 1:
                attendanceManage.add();
                attendance();
                break;
            case 2:
                attendanceInfoManage.show();
                attendance();

                break;
            case 3:
                attendanceManage.delete();
                attendance();

                break;
            case 4:
                finance();

                break;
            default:
               System.out.println("输入错误，请重新输入");
           }
    }


}
